<!DOCTYPE html>
<html lang="">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
    <title><%= htmlWebpackPlugin.options.title %></title>
  </head>
  <body>
    <noscript>
      <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
    </noscript>
        <!-- 嵌入agcloud需要引入的sdk-->
    <script src="./agcloud-sdk/agcloud_import.js"></script>
    <div id="app"></div>
        <!-- built files will be auto injected -->
        <script>

          var CIM = null;
          var CIM_LAYERTREE_NAME = "图层树";
          var CIM_APPLICATION_NAME = "";
          var CIM_APPLICATION_SOFTCODE = "";
          var CIM_USER_NAME = "";
          var CIM_USER_ID = "";
          var TITLE_BAR = "";
          var CIM_PROJECT_CONFIG = {}
          var CIM_VERSION = "自主版";
    
          function loadConfig() {
            xmlhttp = null;
            if (window.XMLHttpRequest) {
              // code for all new browsers
              xmlhttp = new XMLHttpRequest();
            } else if (window.ActiveXObject) {
              // code for IE5 and IE6
              xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            if (xmlhttp != null) {
              xmlhttp.onreadystatechange = state_Change;
              xmlhttp.open("GET", "./config.json", false);
              xmlhttp.send(null);
            } else {
              alert("Your browser does not support XMLHTTP.");
            }
          }
    
          function state_Change() {
            if (xmlhttp.readyState == 4) {
              // 4 = "loaded"
              if (xmlhttp.status == 200) {
                // 200 = OK
                var res = JSON.parse(xmlhttp.response);
                document.title = res.title;
                CIM_LAYERTREE_NAME = res.layerProject;
                CIM_APPLICATION_NAME = res.application;
                TITLE_BAR = res.titleBar;
                CIM_PROJECT_CONFIG.isEmbedAgcloud = res.isEmbedAgcloud;//仅在嵌入agcloud的portal时候启用为true，会跳过登录界面、去掉标题栏
                CIM_PROJECT_CONFIG.useApiGateway = res.useApiGateway;//是否启用agcloud的api网关，2021-08版本以后部署需要使用
                CIM_PROJECT_CONFIG.gatewayApiList = res.gatewayApiList;//api网关地址是接口获取的，而接口就在这里配置，随机挑选，失败就下一个
                CIM_PROJECT_CONFIG.debugAccount = res.debugAccount;
                CIM_PROJECT_CONFIG.sign_login = res.sign_login;
                CIM_PROJECT_CONFIG.sign_login.redirect_uri = window.location.origin;  //单点登录后重定向的主页面,重定向到根路由下
                CIM_VERSION = res.version;
              } else {
                alert("Problem retrieving XML data");
              }
            }
          }
          //加载登录时的配置
          loadConfig();
        </script>
      <!-- 便捷工具类 -->
  <script src="./Build/Cesium/Cesium.js"></script>
  <script>
    //用来监听viewer对象是否初始化完成
    window.CIMViewerPromise = Cesium.defer();
  </script>
  <script src="js/tools.js"></script>
  <script src="js/big.min.js"></script>
  <script src="js/agCIM-SDK-1.1.8.min.js"></script>
  <script src="./agcloud-sdk/updateServerApi.js"></script>
  <style></style>
  </body>
</html>
